package cn.wfu.rlrjds.app.test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/echarts")
public class EntityController {

	private static final Logger logger = LoggerFactory
			.getLogger(EntityController.class);

	@RequestMapping("/line_data")
	@ResponseBody
	public EchartData lineData() {
		logger.info("lineData....");

		List<String> legend = new ArrayList<String>(
				Arrays.asList(new String[] { "最高气温" }));// 数据分组
		List<String> category = new ArrayList<String>(
				Arrays.asList(new String[] { "周一", "周二", "周三", "周四", "周五",
						"周六", "周日" }));// 横坐标
		List<Series> series = new ArrayList<Series>();// 纵坐标

		series.add(new Series("最高气温", "line", new ArrayList<Integer>(Arrays
				.asList(21, 23, 28, 26, 21, 33, 44))));

		EchartData data = new EchartData(legend, category, series);
		return data;
	}

	@RequestMapping("/line_page")
	public String linePage() {
		logger.info("linePage....");
		return "report/line";
	}

}